/****************************************************************************

Force Engine v0.5

Creado: 28/03/08
Clase: Scene.h
Hecho by: German Battiston AKA Melkor

****************************************************************************/

//---------------------------------------------------------------------------
#ifndef SCENE_H
#define SCENE_H
//---------------------------------------------------------------------------
#include "../Input/Input.h"
#include "../Defines/Defines.h"
#include "../Entity2D/Entity2D.h"
#include "../Entity3D/Entity3D.h"
#include "../Graphics/Camera.h"
//---------------------------------------------------------------------------
class Graphics;
class Entity2D;
class Entity3D;
class ConfigFile;
class Input;
class Camera;
//---------------------------------------------------------------------------
class FORCEENGINE_API Scene
{

public:

	Scene();
	Scene(Graphics & rkGraphics);
	virtual ~Scene();

	bool Init(Input * pkInput);
	bool Update(float fTimeBetweenFrames);
	void Draw(Graphics & rkGraphics) const;
	bool DeInit();

	void AddEntity2D(Entity2D * pkEntity2D);
	void AddEntity3D(Entity3D * pkEntity3D);

protected:

	virtual bool OnInit() = 0;
	virtual bool OnUpdate(float fTimeBetweenFrames) = 0;
	virtual void OnDraw(Graphics& rkGraphics) const = 0;
	virtual bool OnDeInit() = 0;

	void SortEntitiesByZ();
	
	Input * m_pkInput;

	Camera * m_pkCamera;

	Graphics * m_pkGraphics;

private:

	std::vector<Entity2D *> m_apkEntities2D;
	std::vector<Entity3D *> m_apkEntities3D;

	static bool Entity2DComp(Entity2D* pkEnt1, Entity2D* pkEnt2);
};
//---------------------------------------------------------------------------
#include "Scene.inl"
//---------------------------------------------------------------------------

#endif /*--- SCENE_H ---*/

//---------------------------------------------------------------------------